-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPC: Add inner instructions to simulate transaction response #34313
RPC: Add inner instructions to simulate transaction response #34313
Conversation
8b59c17
to
573b827
Compare
b726d73
to
a888af0
Compare
3c1e30f
to
c24d74f
Compare
e974a2a
to
ad2e601
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! One attribute request, plus adding the conversion helper fn
And CI being happy, ofc
ad2e601
to
ddc8144
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34313 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 819 820 +1
Lines 220889 220905 +16
=========================================
- Hits 180845 180782 -63
- Misses 40044 40123 +79 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+ one last nit!
Co-authored-by: Tyera <[email protected]>
fe7c680
to
a405a6c
Compare
😱 New commits were pushed while the automerge label was present. |
Problem
Wallets use transaction simulation to notify users about the contents of a transaction before they apply their signature. This is the primary method by which wallets, and potentially other dApps and infrastructure, detect malicious instructions.
Currently, transaction simulation offers the ability to observe the resulting account state for various account keys provided and transaction logs. However, it would provide even more enhanced security for Solana users if transaction simulation also returned the parsed inner instructions of a transaction.
Summary of Changes
The RPC change includes adding an optional parameter -
innerInstructions: bool
- tosimulateTransaction
, and addingjsonParsed
inner instructions to the response type ifinnerInstructions
is provided astrue
. Similar togetTransaction
, if the instruction cannot be parsed withjsonParsed
, it defaults tojson
, where thedata
field is base58 encoded.This change also required the bank to return
inner_instructions
from itssimulate_transaction
method.